package com.example.springsecurity.controller;


import com.example.springsecurity.entity.User;
import com.example.springsecurity.serviceimpl.UserService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author [mybatis plus generator]
 * @since 2024-03-26
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;

    @PostMapping("/add")
    public void add(@RequestBody User user) {
        userService.saveUserDetails(user);
    }

    @GetMapping("/getList")
    public List getList() {
        return userService.list();
    }

}

